﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SisocanaFronEnd.Models.ReportMissingPersonViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Report a missing person
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
    <% Html.EnableClientValidation(); %>
    
    <h2>Report a missing person</h2>

    <% Html.BeginForm("Report"); %>

        <fieldset>
            <legend>Enter the person's first and last names</legend>

            <%= Html.FieldFor(model => model.nombre)%>
            <%= Html.FieldFor(model => model.apellido)%>

            <div class="editor-field">
                <input name="create" type="submit" value="Report" />
            </div>
            
        </fieldset>

        <% if (Model != null){ %>
            <fieldset>
                <legend>Records similar to: <%= Model.nombre + " " + Model.apellido %></legend>
                
                <p>Help us avoid duplicates. Maybe the person you're looking for is listed below: </p>
    
                <%= Html.DisplayFor(model => model.personas)%>

                <p>If none of these records match the person you had in mind, you can click below to create a new record: </p>

                <div class="editor-field">
                    <input name="create" type="submit" value="Create a new record" />
                </div>

            </fieldset>
        <% } %>

    <% Html.EndForm(); %>

</asp:Content>

<script runat="server">
    protected void Page_PreInit(Object sender, EventArgs e)
    {
        Master.MasterPageFile = Url.Content(ViewBag.Site.dir_master);
        MasterPage UserMaster = Master.Master;
        UserMaster.FindControl("NewsTitleContent").Visible = false;
        UserMaster.FindControl("VideoTitleContent").Visible = false;
        UserMaster.FindControl("ImageTitleContent").Visible = false;
    }
</script>